package org.com.yz.dal.dao.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 商户账户信息表
 * </p>
 *
 * @author fjj123
 * @since 2018-06-13
 */
@Getter
@Setter
@TableName("mch_accnt")
public class MchAccnt extends Model<MchAccnt> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @JSONField(name="id_mch_accnt")
    @TableId(value = "id_mch_accnt", type = IdType.AUTO)
    private Integer idMchAccnt;
    /**
     * 商户号
     */
    @JSONField(name="mch_no")
    @TableField("mch_no")
    private String mchNo;
    /**
     * 账户名称
     */
    @JSONField(name="mch_accnt_name")
    @TableField("mch_accnt_name")
    private String mchAccntName;

    /**
     * 子商户号
     */
    @JSONField(name="mch_accnt_no")
    @TableField("mch_accnt_no")
    private String mchAccntNo;

    /**
     * 业务类型
     */
    @JSONField(name="business_type")
    @TableField("business_type")
    private String businessType;

    /**
     * 外部商户账户号
     */
    @JSONField(name="out_mch_accnt_no")
    private String outMchAccntNo;

    /**
     * 是否是供应商子账户
     */
    @Transient
    @JSONField(name="is_supplier")
    private String isSupplier;

    /**
     * 结算周期
     */
    @JSONField(name="settle_duration")
    @TableField("settle_duration")
    private String settleDuration;
    /**
     * 关联银行卡信息
     */
    @JSONField(name="id_bank_card")
    @TableField("id_bank_card")
    private Integer idBankCard;
    /**
     * 账户剩余资金
     */
    @JSONField(name="remain_amt")
    @TableField("remain_amt")
    private Long remainAmt;
    /**
     * 账户类型，depository-存管户,prepay-准备金账户,prepay2-准备金账户2,onway-在途账户,onway2在途账户2,profit-分润账户,assurance-担保金账户,mchsub-子商户账户
     */

    @TableField("accnt_type")
    private String accntType;

    /**
     * 子商户联系邮箱
     */
    @JSONField(name="link_email")
    @TableField("link_email")
    private String linkEmail;

    /**
     * 子商户联系电话
     */
    @JSONField(name="link_phone")
    @TableField("link_phone")
    private String linkPhone;

    /**
     * 子商户联系人
     */
    @JSONField(name="link_name")
    @TableField("link_name")
    private String linkName;

    /**
     * 创建时间
     */
    @JSONField(name="create_time")
    @TableField("create_time")
    private Date createTime;

    @JSONField(name="update_time")
    @TableField("update_time")
    private Date updateTime;


    @Transient
    private List<BankCard> bank_cards;  //子商户对应的银行卡列表

    @Transient
    private  String status;   //开户状态   1-成功；2-失败；3-未知

    @Transient
    private  String desc;    //状态描述



    public MchAccnt(){
    }


    @Override
    protected Serializable pkVal() {
        return this.idMchAccnt;
    }




    @Override
    public String toString() {
        return "MchAccnt{" +
                "idMchAccnt=" + idMchAccnt +
                ", mch_no='" + mchNo + '\'' +
                ", mch_accnt_name='" + mchAccntName + '\'' +
                ", mcha_accnt_no='" + mchAccntNo + '\'' +
                ", out_mch_accnt_no='" + outMchAccntNo + '\'' +
                ", settleDuration='" + settleDuration + '\'' +
                ", idBankCard=" + idBankCard +
                ", remain_amt=" + remainAmt +
                ", accntType='" + accntType + '\'' +
                ", link_email='" + linkEmail + '\'' +
                ", link_phone='" + linkPhone + '\'' +
                ", link_name='" + linkName + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
